#ifndef KEYBOARDEVENT_H_
#define KEYBOARDEVENT_H_

#include <string>
#include <SDL.h>

namespace Lame3d
{
	class KeyEvent
	{
		public:
			KeyEvent(SDL_KeyboardEvent evt);
			KeyEvent(SDLKey k, SDLMod mod, bool pressed);
			~KeyEvent();
		
			bool Pressed() const;
			char Character() const; /* Convert from UNICODE to ASCII/Latin-1 */
			SDLKey Key() const;
			
			SDLMod Modifiers() const;
			bool NumLock() const;
			bool CapsLock() const;
			bool LeftControl() const;
			bool RightControl() const;
			bool Control() const;
			bool LeftShift() const;
			bool RightShift() const;
			bool Shift() const;
			bool LeftAlt() const;
			bool RightAlt() const;
			bool Alt() const;
			
			bool IsText() const;
			
			bool operator==(const KeyEvent &e) const;
			bool operator<(const KeyEvent &e) const;
			
			std::string String() const;
			
		protected:
			SDLKey key;
			SDLMod modifiers;
			bool pressed;
			char character;
	};
	
	class KeyboardCallback
	{
		public:
			KeyboardCallback(const std::string &n);
			virtual ~KeyboardCallback();
			
			const std::string& Name() const;			
			virtual void KeyboardEvent(const KeyEvent &e) = 0;
			
			bool operator==(const KeyboardCallback &kc) const;
			
		protected:
			std::string kcName;
	};
}

#endif /*KEYBOARDEVENT_H_*/
